package com.example.aiagent.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.aiagent.model.entity.ChatHistory;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.aiagent.model.entity.User;

import java.time.LocalDateTime;

/**
* @author wu
* @description 针对表【chat_history(对话历史)】的数据库操作Service
* @createDate 2025-08-06 16:09:18
*/
public interface ChatHistoryService extends IService<ChatHistory> {

    /**
     * 添加对话历史
     * @param appId
     * @param message
     * @param messageType
     * @param userId
     * @return
     */
    boolean addChatMessage(Long appId, String message, String messageType, Long userId);

    /**
     * 删除对话历史
     *
     * @param appId
     * @return
     */
    int deleteChatMessage(Long appId);

    public Page<ChatHistory> listAppChatHistoryByPage(Long appId, int pageSize,
                                                      LocalDateTime lastCreateTime,
                                                      User loginUser);
}
